

package com.hazelcast.map.impl.query;

import com.hazelcast.internal.util.HashUtil;

import java.io.Serializable;

public class CustomAttribute implements Serializable, Comparable<CustomAttribute> {

    private final int age;
    private final long height;

    public CustomAttribute(int age, long height) {
        this.age = age;
        this.height = height;
    }

    @Override
    public int compareTo(CustomAttribute o) {
        return age - o.age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CustomAttribute that = (CustomAttribute) o;
        if (age != that.age) {
            return false;
        }
        return height == that.height;
    }

    @Override
    public int hashCode() {
        return HashUtil.hashCode(age, height);
    }
}
